<!--

    Copyright 2010 Guadaltel, S.A.

    Licensed under the EUPL, Version 1.1 or - as soon they
    will be approved by the European Commission - subsequent
    versions of the EUPL (the "Licence");
    you may not use this work except in compliance with the
    Licence.
    You may obtain a copy of the Licence at:

    http://ec.europa.eu/idabc/eupl

    Unless required by applicable law or agreed to in
    writing, software distributed under the Licence is
    distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
    express or implied.
    See the Licence for the specific language governing
    permissions and limitations under the Licence.

-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a="http://richfaces.org/a4j"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:rich="http://richfaces.org/rich">
<f:view>


	<head>
	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	    <title><h:outputText value=""/></title>
	    <link rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/temas/tablon/css/estilo.css" type="text/css"></link>
	</head>
	<body>

		<!--  Scripts de authenticator con certificado	-->
		<script type="text/javascript" language="javascript"
			src="#{facesContext.externalContext.requestContextPath}/common-js/clientSigner.js"></script>

		<div id="header-bg">
			<div class="header-center">
			<div class="header-left"></div>
				<div class="logo-left"><h:graphicImage value="/temas/tablon/imagenes/logo-gonce.png"/></div>

				<div class="header-right"></div>
				<div class="logo-right"><h:graphicImage value="../temas/tablon/imagenes/logo-grepresenta.png"/></div>
			</div>
		</div>
		 <div class="clearIt"></div>
		<h:form>
		<div id="home">
			<div class="loader">
				<a:status id="status" layout="block">
		        	<f:facet id="StartStatus" name="start">
		        		<h:panelGroup styleClass="loading">
							<h:graphicImage value="/temas/tablon/iconos/ajax-loader.gif" />
						</h:panelGroup>
		          	</f:facet>
		    	</a:status>
			</div>
			<div class="user-name"></div>
		</div>
		</h:form>
		<div class="clearIt"></div>

		<div id="toolbar-bg">
			<div class="toolbar-center">
			<div class="toolbar-left"></div>
			<div class="toolbar-right"></div>
			</div>
		</div>
		<div class="clearIt"></div>

		<div id="content-bg">
			<div class="content-center">
				<div class="content-left">
					<div class="content-right">
					<div class="lat-left"></div>
						<div class="content-data">

							<rich:spacer height="30px"/>

							<h:outputText value="#{messages['message.loading']}" styleClass="bold magenta"/>

							<script>
							  function endSign(clientSignerResult)
							  {
								document.getElementById("clientSignerResult").value = clientSignerResult;
								document.getElementById("certificateForm:certificateButtonHidden").click();
							  }
							</script>

							<h:form id="certificateForm" >
								<input type="hidden" id="clientSignerResult" name="clientSignerResult"/>
								<input type="hidden" id="typeAuthentication" name="typeAuthentication" value="certificate"/>
								<h:commandButton id="certificateButtonHidden" action="#{identity.login}" style="visibility:hidden;" />
							</h:form>

							<rich:spacer height="200px"/>

							<div align="center">
								<h:graphicImage value="/temas/tablon/iconos/ajax-loader-certificate.gif"/>
							</div>

						</div>
						<div class="lat-right"></div>
					</div>
				</div>
			</div>
		</div>
			<div class="clearIt"></div>

		<h:form>
			<div id="footer-bg">
				<div class="footer-center">
					<div class="footer-left">
					</div>
					<div class="text-footer">
						<h:outputLabel value="#{messages['title.project']}" />
					</div>
					<div class="footer-right">
					</div>
				</div>
			</div>
		</h:form>
		<div class="clearIt"></div>

		<script type="text/javascript">authenticate(${clientSignerConfig}, 'endSign');</script>

	</body>
</f:view>
</html>